home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 9 / Amoszine 9 (Disk 3 of 3).adf / AJC_Source.lha / AJC-VARSWAPPER.AMOS / AJC-VARSWAPPER.amosSourceCode
AMOS Source Code  |  1995-08-01  |  790b  |  39 lines

  1. '  
  2. ' VARIABLE SWAPPER 
  3. ' ** Requires the JD Extension!! **  
  4. ' By Andrew Campbell 
  5. '
  6. ' This routine simply swaps any amount of one single character 
  7. ' contained within a string to another of your specified choice. 
  8. ' Run the program for an example. Could be useful to somebody  
  9. ' else, as it was very useful for me when I coded Magnetic Fiction 
  10. ' for F1 Licenceware.  
  11. '  
  12. ' - AJC  
  13. '
  14. Curs Off : Flash Off : Cls 0 : Hide On : Colour 1,$FFF : Pen 1 : Paper 0
  15.  
  16. _XCHANGE["Get*rid*of*all*the*stars!","*"," "]
  17.  
  18. Print 
  19. Print "Press any key"
  20. Wait Key 
  21. Print 
  22.  
  23. _XCHANGE["Swap*the*stars*for*dashes!","*","-"]
  24.  
  25. Wait 20
  26. Edit 
  27.  
  28. Procedure _XCHANGE[_SOURCE$,A$,B$]
  29.  
  30. _CNT= Extension_22_005A(_SOURCE$,A$)
  31.  
  32. For _TM=1 To _CNT
  33.   X=Instr(_SOURCE$,A$)
  34.   Mid$(_SOURCE$,X)=B$
  35. Next _TM
  36.  
  37. Print _SOURCE$
  38.  
  39. End Proc